import HospitalSet from "@/pages/hospital/HospitalSet";
import { request } from "@/utils/http";
import { AntAnchor } from "antd/lib/anchor/Anchor";
import { ReqHospitalSetListParams, ReqHospitalSetListResponse,AddHospitalParams,UpdateHospitalParams, HospitalItem } from "./model/hospitalSetTypes";

/**
 * 请求  获取医院设置列表的 方法
 * @param param0   {page,limit,hoscode,hosname}:ReqHospitalSetListParams
 * @returns Promise<ReqHospitalSetListResponse>
 */
export function ReqGetHospitalSetListResponse({page,limit,hoscode,hosname}:ReqHospitalSetListParams){
    return request.get<any,ReqHospitalSetListResponse>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params: {
            hoscode,
            hosname
        }
    })
}

/**
 * 请求添加医院方法
 * @param hospitalSet ：AddHospitalParams
 * @returns  Promise<null>
 */
export function ReqAddHospital(hospitalSet:AddHospitalParams){
    return request.post<any,null>("/admin/hosp/hospitalSet/save",hospitalSet)
}

/**
 * 更新单个医院设置 请求的医院数据方法
 * @param id number
 * @returns  
 */
export function ReqGetHospitalSetItem(id:string){
    return request.get<any,HospitalItem>(`/admin/hosp/hospitalSet/get/${id}`)
}

/**
 * 请求更新医院的方法
 * @param hospitalSet UpdateHospitalParams
 * @returns Promise<null>
 */
export function ReqUpdateHospital(hospitalSet:UpdateHospitalParams){
    return request.put<any,null>("/admin/hosp/hospitalSet/update",hospitalSet)
}